<?php get_header(); ?>

<!-- main content start -->

<div class="castshadow grid_8 clearfix">

	<!-- title start -->

    <h1><?php the_title(); ?></h1>
    
    <!-- title end -->
    
    <!-- content start -->

    <div class="entry-attachment">
    
	<?php 
	if( wp_attachment_is_image( $post->ID ) ) { 
		$att_image = wp_get_attachment_image_src( $post->ID, 'large' ); 
	?>
    
    <p>
        <a href="<?php echo wp_get_attachment_url( $post->ID ); ?>" title="<?php the_title(); ?>">
        	<img src="<?php echo $att_image[ 0 ];?>" class="size-large alignleft" alt="<?php $post->post_excerpt; ?>" />
        </a>
    </p>
    
	<?php } else { ?>
    
    <p>
        <a href="<?php echo wp_get_attachment_url( $post->ID ) ?>" title="<?php echo esc_html( get_the_title( $post->ID ), 1 ); ?>" rel="attachment">
            <?php echo basename( $post->guid ); ?>
        </a>
    </p>
    
	<?php } ?>
    
    </div>
    
	<?php 
	// any image description? If true - display it!
    if( !empty( $post->post_excerpt ) ) {
        echo '<div class="entry-caption">';
        the_excerpt();
        echo '</div>'; 
    }
    ?>
    
    <!-- content end -->
 
</div>

<!-- main content end -->

<!-- include sidebar start -->

    <?php get_template_part( 'sidebar_single' ); ?>
    
<!-- include sidebar end -->

<?php get_footer(); ?>